<div id="header" class="sticky clearfix header-sm ">

	<header id="topNav">
		<div class="container">

			<!-- Mobile Menu Button -->
			<button class="btn btn-mobile" id="sidepanel_btn">
				<i class="fa fa-bars"></i>
			</button>

			<!-- BUTTONS -->
			<ul class="pull-right nav nav-pills nav-second-main">
				<!--
                &lt;!&ndash; SEARCH &ndash;&gt;
                <li class="search">
                    <a href="javascript:;">
                        <i class="fa fa-search"></i>
                    </a>
                    <div class="search-box">
                        <form action="/search" method="get">
                            <div class="input-group">
                                <input type="text" name="q" placeholder="Search" class="form-control" />
                                <span class="input-group-btn">
                                                <button class="btn btn-primary" type="submit">搜索</button>
                                            </span>
                            </div>
                        </form>
                    </div>
                </li>
                &lt;!&ndash; /SEARCH &ndash;&gt;
                -->
				{% if 4|getmode('')|length>0 %}
				<!-- QUICK SHOP CART -->
				<li class="quick-cart">
					<a href="#">
						<span class="badge badge-aqua btn-xs badge-corner" id="badge-corner">{% if controller.cart.num %}{{controller.cart.num}}{%endif%}</span>
						<i class="fa fa-shopping-cart"></i>
					</a>

					<div class="quick-cart-box">
						<h4>购物车</h4>

						<div class="quick-cart-wrapper">
							{% if controller.cart.data|length > 0 %}
							{% for val in controller.cart.data%}
							<a href="{{val.url}}">
								<img src="{{val.pic}}" width="45" height="45" alt=""/>
								<h6><span>{{val.qty}}x</span> {{val.title}}</h6>
								<small>&nbsp;<!--￥{{val.price|formatCurrency}} {% if val.type%}<span class="size-11 text-muted">[{{val.type}}]</span>{%endif%}--></small>
							</a>
							{% endfor %}
							{%else%}
							<a class="text-center" href="#">
								<h6> 购物车内暂时没有商品!</h6>
							</a>
							{%endif%}


						</div>

						<!-- quick cart footer -->
						<div class="quick-cart-footer clearfix">
							<a href="/center/cart" class="btn btn-primary btn-xs pull-right">去购物车结算</a>
							<span class="pull-left"><strong>合计:</strong> <total>￥{% if controller.cart.total %}{{controller.cart.total|formatCurrency}}{%else%}0{%endif%}</total></span>
						</div>
						<!-- /quick cart footer -->

					</div>

				</li>
				<!-- /QUICK SHOP CART -->
				{%endif%}
			</ul>
			<!-- /BUTTONS -->


			<!-- Logo -->
			<a class="logo logo-svg pull-left" href="/">
				<img src="/static/assets/images/logo.png" alt=""/>
			</a>

			<div class="navbar-collapse pull-right nav-main-collapse collapse">
				<nav class="nav-main">

					<ul id="topMain" class="nav nav-pills nav-main">
						{% channel data='channel'%}
						{% for val in channel%}
						{%if val.status > 0%}
						<li class="{% if val.children %}dropdown{% endif %} {% if (category.id|in_Array(val.on)) or (val.url|in_Array(controller.active)) %}active{% endif %}">

							<a {% if val.children%}class="dropdown-toggle" {% endif %} href="{{val.url}}" {%if
							   val.target==1%} target="_blank" {%endif%}>{{val.title}}</a> {% if val.children%}
							<ul class="dropdown-menu">
								{% for _val in val.children%}
								{%if _val.status > 0%}
								<li class="{% if _val.children%}dropdown{% endif %} {% if category.id|in_Array(_val.on) %}active{% endif %}">
									<a {% if _val.children%}class="dropdown-toggle" {% endif %} href="{{_val.url}}" {%if
									   _val.target==1%} target="_blank" {%endif%}>{{_val.title}}</a> {% if
									_val.children%}
									<ul class="dropdown-menu">
										{% for __val in _val.children%}
										{%if __val.status > 0%}
										<li class="{% if category.id|in_Array(__val.on) %}active{% endif %}"><a
												href="{{__val.url}}" {%if __val.target==1%} target="_blank" {%endif%}>{{__val.title}}</a>
										</li>
										{% endif%}
										{% endfor %}
									</ul>
									{% endif %}
								</li>
								{% endif%}
								{% endfor %}
							</ul>
							{% endif %}
							<span class="aline"></span>
						</li>
						{%endif%}
						{% endfor%}

						{% if controller.user.roleid == 9 %} <!--客户-->
						<li class="{% if controller.ctx.url|index_of('/centershop') %} active {% endif %}">
							<a href="/centershop{% if controller.user.mar_class %}?class={{controller.user.mar_class}}{% endif %}">网上商城</a>
							<span class="aline"></span>
						</li>
						<li class="dropdown {% if controller.ctx.url|index_of('/center/') %} active {% endif %}">
							<a class="dropdown-toggle" href="/center/reconciliation/contract">账目信息</a>
							<ul class="dropdown-menu has-topBar">
								<li class="{% if controller.ctx.url|index_of('/center/reconciliation/contract') %} active {% endif %}">
									<a href="/center/reconciliation/contract">销售合同</a>
								</li>
								<li class="{% if controller.ctx.url|index_of('/center/reconciliation/company') %} active {% endif %}">
									<a href="/center/reconciliation/company">公司余额</a>
								</li>
								<li class="{% if controller.ctx.url|index_of('/center/reconciliation/order') %} active {% endif %}">
									<a href="/center/reconciliation/order">订单明细</a>
								</li>
								<li class="{% if controller.ctx.url|index_of('/center/reconciliation/settlement') %} active {% endif %}">
									<a href="/center/reconciliation/settlement">发货明细</a>
								</li>
								<li class="{% if controller.ctx.url|index_of('/center/reconciliation/payment') %} active {% endif %}">
									<a href="/center/reconciliation/payment">收款明细</a>
								</li>
								<li class="{% if controller.ctx.url|index_of('/center/reconciliation/invoice') %} active {% endif %}">
									<a href="/center/reconciliation/invoice">发票明细</a>
								</li>
								<!--<li class="{% if controller.ctx.url|index_of('/center/reconciliation/back') %} active {% endif %}">
									<a href="/center/reconciliation/back">回款明细</a>
								</li>-->
							</ul>
							<span class="aline"></span>
						</li>
						{% elif controller.user.roleid == 10 %} <!--供应商-->
						<li class="dropdown {% if controller.ctx.url|index_of('/center') %} active {% endif %}">
							<a class="dropdown-toggle" href="/center/index">账目信息</a>
							<ul class="dropdown-menu has-topBar">
								<!--<li class="{% if controller.ctx.url|index_of('/center/index') %} active {% endif %}">
									<a href="/center/index">供应商主页</a>
								</li>-->
								<li class="{% if controller.ctx.url|index_of('/center/reconciliation/company') %} active {% endif %}">
									<a href="/center/reconciliation/company">公司余额</a>
								</li>
								<li class="{% if controller.ctx.url|index_of('/center/reconciliation/settlement') %} active {% endif %}">
									<a href="/center/reconciliation/settlement">收货明细</a>
								</li>
								<li class="{% if controller.ctx.url|index_of('/center/reconciliation/payment') %} active {% endif %}">
									<a href="/center/reconciliation/payment">付款明细</a>
								</li>
								<li class="{% if controller.ctx.url|index_of('/center/reconciliation/billing') %} active {% endif %}">
									<a href="/center/reconciliation/billing">发票明细</a>
								</li>
								<!--<li class="{% if controller.ctx.url|index_of('/center/reconciliation/payment') %} active {% endif %}">
									<a href="/center/reconciliation/payment">付款明细</a>
								</li>-->
							</ul>
							<span class="aline"></span>
						</li>
						{% endif %}

					</ul>
				</nav>
			</div>

		</div>
	</header>
	<!-- /Top Nav -->

</div>
